package com.slz3.business.module.orderManagement.ordOrderLine.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordOrderLine.domain.OrdOrderLine;
import com.slz3.business.module.orderManagement.ordOrderLine.domain.OrdOrderLineCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdOrderLineResController {

    static Mono<ServerResponse> add(ServerRequest req, OrdOrderLine ordOrderLine) {
        if (OrdOrderLineResUnsafeValid.add(req, ordOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.add_$OrdOrderLineUpdateLock(req, ordOrderLine);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        if (OrdOrderLineResUnsafeValid.delete(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.delete_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, OrdOrderLine ordOrderLine) {
        if (OrdOrderLineResUnsafeValid.modify(req, ordOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.modify_$OrdOrderLineUpdateLock(req, ordOrderLine);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (OrdOrderLineResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> findBySerOrderId(ServerRequest req) {
        if (OrdOrderLineResUnsafeValid.findBySerOrderId(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResExecutor.findBySerOrderId(req);
        }
    }


    static Mono<ServerResponse> info(ServerRequest req) {
        if (OrdOrderLineResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.info_$OrdOrderLineUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (OrdOrderLineResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        //
        if (OrdOrderLineResUnsafeValid.auditSubmit(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.auditSubmit_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        if (OrdOrderLineResUnsafeValid.audit(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.audit_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        if (OrdOrderLineResUnsafeValid.auditReject(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.auditReject_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        if (OrdOrderLineResUnsafeValid.usingEnable(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.usingEnable_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        if (OrdOrderLineResUnsafeValid.usingDisable(req, ordOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdOrderLineResAtomic.usingDisable_$OrdOrderLineUpdateLock(req, ordOrderLineCondition);
        }
    }

}
